<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>phpWallet</title>

<link rel="stylesheet" type="text/css" href="js/yui/build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="js/yui/build/container/assets/skins/sam/container.css" />

<link rel="stylesheet" type="text/css" href="js/yui/build/button/assets/skins/sam/button.css" />

<link rel="stylesheet" type="text/css" href="js/yui/build/menu/assets/skins/sam/menu.css" />

<link rel="stylesheet" type="text/css" href="js/yui/build/tabview/assets/skins/sam/tabview.css" />

<link rel="stylesheet" type="text/css" href="js/yui/build/datatable/assets/skins/sam/datatable.css" />

<link rel="stylesheet" type="text/css" href="js/yui/build/calendar/assets/skins/sam/calendar.css" />

<script type="text/javascript" src="js/yui/build/yahoo/yahoo.js"></script>
<script type="text/javascript" src="js/yui/build/dom/dom.js"></script>
<script type="text/javascript" src="js/yui/build/event/event.js"></script>
<script type="text/javascript" src="js/yui/build/connection/connection.js"></script>
<script type="text/javascript" src="js/yui/build/animation/animation.js"></script>
<script type="text/javascript" src="js/yui/build/dragdrop/dragdrop.js"></script>
<script type="text/javascript" src="js/yui/build/element/element-beta.js"></script>

<script type="text/javascript" src="js/yui/build/json/json-beta.js"></script>

<script type="text/javascript" src="js/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>

<script type="text/javascript" src="js/yui/build/container/container.js"></script>

<!-- 
yahoo/yahoo.js
dom/dom.js
event/event.js
connection/connection.js
animation/animation.js
dragdrop/dragdrop.js
element/element.js
-->
<!--
<script type="text/javascript" src="js/yui/build/utilities/utilities.js"></script>
-->

<script type="text/javascript" src="js/yui/build/menu/menu.js"></script>

<script type="text/javascript" src="js/yui/build/button/button.js"></script>

<script type="text/javascript" src="js/yui/build/tabview/tabview.js"></script>

<script type="text/javascript" src="js/yui/build/datasource/datasource-beta.js"></script>
<script type="text/javascript" src="js/yui/build/datatable/datatable-beta.js"></script>

<script type="text/javascript" src="js/yui/build/calendar/calendar.js"></script>

<link rel="stylesheet" type="text/css" href="js/yuifx/assets/yuifx.css" />
<script type="text/javascript" src="js/yuifx/yuifx.js"></script>

<link rel="stylesheet" type="text/css" href="css/money/money.css" />
<link rel="stylesheet" type="text/css" href="css/wallet/wallet.css" />

<link rel="stylesheet" type="text/css" href="css/yui-hack/yui-hack.css" />

<script type="text/javascript" src="js/money/util.js"></script>
<script type="text/javascript" src="js/money/account.js"></script>
<script type="text/javascript" src="js/wallet/wallet.js"></script>

<?php

include_once("controller/action/AccountAction.php");
$action = new AccountAction();
$accountList = $action->index();
$inAccountList = $accountList["in"];
$outAccountList = $accountList["out"];

$accountStats = $action->stats();

$accountCategory = $action->selectCategory();

$accountListByMonth = $action->indexByMonth();
$statisticListByDay = $action->statisticByDay();
?>

<script type="text/javascript">
	var monthStatisticTable = [
		<?php
		$first = true;
		foreach($accountListByMonth as $month => $oneDayAccountList) {
			if (!$first) {
				echo ", ";
			} else {
				$first = false;
			}
			echo "'$month'";	
		}
		?>
	];
</script>
</head>
<body>
<div id="board">
	<div class="hd">phpWallet - Your honest money manager</div>
	<div class="bd">
		<div id="toolbar" class="logo">
			<fieldset id="add-info">
				<legend>Add</legend>
				<button id="add-in">Income</button>
				<button id="add-out">Expenditure</button>		
			</fieldset>
			
			<!--  
			<div id="logo">
				<img src="image/logo/31.gif"></img>
			</div>
			-->
		</div>
		
		<div id="content">
			<div id="account-info-tab-view" class="yui-navset account-record-info">
			    <ul class="yui-nav">
			    	<li><a href="#tab-view-overview"><em>Overview</em></a></li>
			        <li><a href="#tab-view-statistic"><em>Statistic</em></a></li>
			    </ul>            
			    <div class="yui-content">
			    	<div id="tab-view-overview">
			    		<select>
			    			<option>按月查看</option>
			    			<option>按年查看</option>
			    		</select>
			        	
			        	<div id="stats-data-table"></div>
			        </div>
			        <div id="tab-view-statistic">
			        	<!-- 每月消费详情统计 -->
			        	<?php include("template/month-statistic-tab-view.php"); ?>
			        </div>
			    </div>
			</div>
		</div>		
	</div>
	<div id="copyright" class="ft">
		<span>Copyright &copy; 2007 Biao Zhang</span>
		<span id="loading-tip" class="loading" style="display: none;">Loading...</span>
	</div>
</div>

<div id="template" class="template">
	<!-- 消费记录详情面板 -->
	<?php include("template/account-detail-panel.php"); ?>
	
	<!-- 添加销费类型面板 -->
	<?php include("template/account-category-panel.php"); ?>
	
	<!-- 添加销费记录面板 -->
	<?php include("template/account-add-panel.php"); ?>
	
	<!-- 全局统计列表 -->
	<?php include("template/global-statistic-data-table.php"); ?>
	
	<!-- 用户帐户的销费流水帐列表 -->
	<?php //include("template/account-data-table.php"); ?>
</div>

</body>
</html>